// blobUrl转化为Base64
export async function blobUrlToBase64(blob) {
  return new Promise((resolve, reject) => {
    const xhr = new XMLHttpRequest;
    xhr.responseType = 'blob';
    xhr.onload = function() {
      const recoveredBlob = xhr.response;
      const reader = new FileReader;
      reader.onload = function() {
        const blobAsDataUrl = reader.result;
        resolve(blobAsDataUrl)
      };
      reader.readAsDataURL(recoveredBlob);
    };
    xhr.open('GET', blob);
    xhr.send();
  })
}